from django.conf              import settings
from django.utils             import translation
from sitepal.sitebase.conf    import properties
from sitepal.sitetheme.models import Theme

def site_charset(self):
    return self.escape(properties.get('site-charset',settings.DEFAULT_CHARSET,admin=True))

def site_content_type(self):
    return self.escape(properties.get('site-content-type',settings.DEFAULT_CONTENT_TYPE,admin=True))

def site_language(self):
    return self.escape(translation.get_language())

def site_language_dir(self):
    return self.escape('rtl' if translation.get_language_bidi() else 'ltr')

def site_languages(self):
    return self.escape(settings.LANGUAGES)

def site_slogan(self):
    return self.escape(properties.get('site-slogan','',admin=True))

def site_theme_name(self):
    return self.escape(Theme.objects.get_current().name)

def site_name(self):
    return self.escape(properties.get('site-name','',admin=True))

